﻿@using EC.Entity.Enum;
@{
    Layout = "~/Views/Shared/_Dialog.cshtml";
}
@model EC.Entity.Response.DepositRecord.DepositRecordResponse
@section headScripts{
    <script type="text/javascript" src="@Url.Content("~/lib/date/wdatepicker.js")"></script>
}
<section class="container-fluid" style="background-color: white;">
    <form class="form-horizontal m15_t" id="form">
        <div class="tab-content">
            <input type="hidden" id="Id" name="Id" value="0">
            <div class="tab-pane fade in active" id="home">
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>商户：</label>
                    <div class="wd250">
                        <select name="merchantId" class="form-control">
                            <option value="">选择商户</option>
                            @{
                                if (Model != null && Model.MerchantResponse != null && Model.MerchantResponse.Any())
                                {
                                    foreach (var item in (List<EC.Entity.Response.Merchant.MerchantResponse>)Model.MerchantResponse)
                                    {
                                        <option value="@(item.Id)">@(item.Name)</option>
                                    }
                                }
                            }
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>收款卡号：</label>
                    <div class="wd250">
                        <select name="depositCardNumber" class="form-control">
                            <option value="">选择收款卡号</option>
                            @{
                                if (Model != null && Model.BankCardResponse != null && Model.BankCardResponse.Any())
                                {
                                    foreach (var item in (List<EC.Entity.Response.BankCard.BankCardResponse>)Model.BankCardResponse)
                                    {
                                        <option value="@(item.BankCardNumber)">@(item.BankName)-(@(item.BankCardName)@(item.BankCardNumber))</option>
                                    }
                                }
                            }
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label">交易类型：</label>
                    <div class="wd250">
                        <select name="transtype" class="form-control">
                            <option value="">选择交易类型</option>
                            <option value="1">云闪付</option>
                            <option value="3">网银转账</option>
                            <option value="3">微信转账</option>
                            <option value="3">支付宝支付</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label"><span class="WdateFmtErr">*</span>存款金额：</label>
                    <div class="wd250">
                        <input class="form-control" type="text" name="depositAmount" maxlength="10" value="" autocomplete="off" placeholder="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label">存款时间：</label>
                    <div class="wd250">
                        <input class="form-control" type="text" name="depositDate" maxlength="40" value="" autocomplete="off" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'%y-%M-%d'})" placeholder="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label">客户银行名称：</label>
                    <div class="wd250">
                        <input class="form-control" type="text" name="clientBankName" maxlength="20" value="@(Model.ClientBankName)" autocomplete="off" placeholder="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label">客户银行姓名：</label>
                    <div class="wd250">
                        <input class="form-control" type="text" name="clientCardName" maxlength="20" value="@(Model.ClientCardName)" autocomplete="off" placeholder="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="wd100 control-label">客户银行卡号：</label>
                    <div class="wd250">
                        <input class="form-control" type="text" name="clientCardNumber" maxlength="20" value="@(Model.ClientCardNumber)" autocomplete="off" placeholder="">
                    </div>
                </div>
            </div>
        </div>
    </form>
</section>
@section footerScript{
    <script type="text/javascript">

        function save() {

            var cover = FlashPay.UI.Mask({
                obj: $("body"),
                opacity: 0.5
            });

            var data = $("#form").serializeJSON();
            //状态
            //data.status = $("input[name='status'][checked]").val();

            FlashPay.Util.Ajax({
                type: "POST",
                url: "/DepositRecord/SaveDepositRecord",
                data: data,
                success: function (res) {
                    if (res.success) {
                        cover.Remove();
                        FlashPay.UI.DialogOpener().Tip_success("操作成功！");
                        FlashPay.UI.DialogOpener().doSearch();
                        FlashPay.UI.CloseDialog();
                    } else {
                        cover.Remove();
                        FlashPay.UI.Tip_short_warning("操作失败！" + res.message);
                    }
                },
                error: function (json) {
                    cover.Remove();
                    FlashPay.UI.Tip_warning("操作失败！请查看网络，请重试。");
                }
            });

        }
    </script>
}